<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org" th:fragment="part">
<head>
    <title>viewOPost</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}" />
    <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript" src="../js/om/hrmlog.js"></script>
    <script type="text/javascript">
        function deleteItems() {
            document.getElementById("listFrom").submit();
        }
    </script>
</head>
<body>
<div id="wrap">
    <div id="wrapper">
        <ul class="first">
            <li><a href="/om/viewOUser">组织党员管理</a></li>
            <li><a href="/om/viewDGroup">组织管理</a></li>
            <li><a href="/om/viewOPost">组织帖子管理</a></li>
        </ul>
    </div>
    <div id="big">
        <div id="top_content">
            <div id="content">
                <form th:action="@{deleteItems}" method="get" id="listFrom">
                    <input type="submit" name="deleteItems" value="删除选中帖子" class="button" onclick="deleteItems()"/>
                    <table class="table" >
                        <tr class="table_header">
                            <td width="30px">

                            </td>
                            <td width="300px">
                                标题
                            </td >
                            <td width="150px">
                                类型
                            </td>
                            <td width="100px">
                                作者
                            </td>
                            <td width="95px">
                                点赞
                            </td>
                            <td width="95px">
                                收藏
                            </td>
                            <td width="280px">
                                发表时间
                            </td>
                            <td width="100px">
                                操作
                            </td>
                        </tr>
                    </table>
                    <table class="table" id="adminTbody">
                        <tr  th:each="opost,state:${opost}"th:class="${state.odd?'row1':'row2'}">
                            <td width="30px">
                               <input type="checkbox" name="chkpIds" class="button" th:value="${opost.pid}">
                            </td>

                            <td width="300px">
                                <a th:href="@{'http://localhost:8080/html/editor/viewPost.do?pid=' + ${opost.pid}}" target="_blank" th:text="${opost.ptitle}"></a>
    <!--                            <span th:text="${opost.ptitle}"></span>-->
                            </td>
                            <td width="150px">
                                <span th:text="${opost.ptype}"></span>
                            </td>
                            <td width="100px">
                                <span th:text="${opost.realname}"></span>
                            </td>
                            <td width="95px">
                                <span th:text="${opost.giveup}"></span>
                            </td>
                            <td width="95px">
                                <span th:text="${opost.collect}"></span>
                            </td>
                            <td width="280px">
                                <span th:text="${opost.ptime}"></span>
                            </td>
                            <td width="100px">
    <!--                            <a th:href="@{deleteOPost(pid=${opost.pid})}">删除</a>-->
                                <a href="javascript:;" th:onclick="deleteOPost([[${opost.pid}]])">删除</a>
                            </td>
                        </tr>
                        <script>
                            function deleteOPost(pid){
                                console.log(pid);
                                if(window.confirm('确定要删除吗?')){
                                    location.href='[[@{deleteOPost?pid=}]]'+pid;
                                }
                            }
                        </script>
                    </table>
                    <div class="layui-card-body ">
                        <div class="page">
                            <div>
                                <a class="num" href="###" id="firstPage">首页</a>
                                <a class="prev" href="###" id="prePage">&lt;&lt;</a>
                                <span class="current" id="currentPage"></span>
                                <a class="next" href="###"id="nextPage">&gt;&gt;</a>
                                <a class="num" href="###" id="lastPage">尾页</a>
                                <a class="num" href="###" id="totalpage"></a>
                                <a class="num"> <select  id="jumpWhere"> </select></a>
                                <a href="###" id="jumpPage" onclick="jumpPage()">跳转</a>
                                <a class="num" id="countsum"></a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>